// Fill out your copyright notice in the Description page of Project Settings.


#include "EmyAnima/EmyAnimInstance.h"
#include "Emy/EmyCharacter.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Kismet/KismetMathLibrary.h"


void UEmyAnimInstance::NativeInitializeAnimation()
{
	Super::NativeInitializeAnimation();
	EmyPlayer = Cast<AEmyCharacter>(TryGetPawnOwner());
	if (EmyPlayer) {
		EmyMove = EmyPlayer->GetCharacterMovement();
	}
}

void UEmyAnimInstance::NativeUpdateAnimation(float DeltaTime)
{
	Super::NativeUpdateAnimation(DeltaTime);
	if (EmyMove) {

		Speed = UKismetMathLibrary::VSizeXY(EmyMove->Velocity);
	}
}
